package com.example.app1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TabHost;

public class Tabhostlayout7Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabhostlayout_7);


        TabHost th = (TabHost) findViewById(R.id.tabhost);
        th.setup(); //初始化容器

        th.addTab(th.newTabSpec("tab1").setIndicator("要闻",null).setContent(R.id.tab1));
        th.addTab(th.newTabSpec("tab2").setIndicator("热点",null).setContent(R.id.tab2));
        th.addTab(th.newTabSpec("tab3").setIndicator("奥运专辑",null).setContent(R.id.tab3));

    }
}